import service from '@/service/request'

/*登录*/
export function login(data: any) {
  return service({
    url: '/auth/login',
    method: 'post',
    data
  })
}

/*教师登录后获取直播间信息*/
export function info() {
  return service({
    url: '/trtc/courseLive/info',
    method: 'get'
  })
}

/*获取学员信息*/
export function studentInfo() {
  return service({
    url: '/member/user/info',
    method: 'get'
  })
}

/*退出登录*/
export function logout(data: any) {
  return service({
    url: '/auth/logout',
    method: 'delete',
    data
  })
}

/*获取临时令牌*/
export function sig() {
  return service({
    url: '/trtc/tencent/doc/sts/sig',
    method: 'get'
  })
}

/*创建转码任务*/
export function uploads(data: any) {
  return service({
    url: '/trtc/tencent/doc/uploads',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

/*获取转码任务信息*/
export function taskInfo(taskId: string) {
  return service({
    url: `/trtc/tencent/doc/${taskId}/info`,
    method: 'post'
  })
}

/*修改信息*/
export function updateInfo(data: any) {
  return service({
    url: `/member/user/pwd`,
    method: 'put',
    data
  })
}
